Repository navigation
Fail a breaking pull request until it gets the allow label - #83
Merged
Merged
Conversation
Mpdreamz
force-pushed
the
typed-fail-on
branch
from
November 14, 2026 08:47
76f7b47 to
327dea6
Compare
A breaking change could be labelled but not held back with a way to say it was intended. pull-request --fail-on major now fails the check on a change that big, unless the pull request has the breaking-allowed label; the comment says which label lets it through. Adding the label reruns the workflow, which passes and keeps the breaking label for release-drafter. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mpdreamz
force-pushed
the
allow-label
branch
from
November 14, 2026 08:53
ccfdf0b to
6cfe4b7
Compare
Mpdreamz
added a commit
that referenced
this pull request
Nov 14, 2026
…#84) `uses: nullean/assembly-differ@v1` now compares a pull request's libraries with their last release, comments, sets the release-drafter label, and fails on a breaking change until the pull request gets the `breaking-allowed` label. The old inputs still work. **Prompt summary:** The action's arguments are hard to use, and there is no clear path to hooking it up to pull requests. It should set the `breaking` label, fail, and pass once a configurable allow label is added: the author makes a breaking change, the action detects it, labels it and fails, the author adds the allow label, and the next run succeeds. ## Why The action ran `assembly-differ diff <first> <second> <args>` in a container: two provider specs and a free-form string. It had no outputs and did nothing on the pull request. Wiring it up took a hand-written workflow around it. ## What #### A composite action It installs the tool with `dotnet tool`, so the solution mode can read the projects with the SDK the build already set up. Without `package` it runs `projects`, comparing every library of the solution in `working-directory` with its latest release; with `package` it runs `release` on that `.nupkg`. The report goes to `api-changes.json`, and `pull-request` puts it on the pull request. #### Typed inputs and outputs The inputs are `package`, `projects`, `target`, `framework`, `fail-on` (default `major`), `allow-label` (default `breaking-allowed`), the three label names, `comment`, `labels`, `working-directory`, `token` and `version`. The outputs are `suggested-change`, `breaking-changes` and `report`. Every input reaches the scripts through environment variables, never through `${{ }}` inside `run:`, so `zizmor` reports no findings. The tool is called by path, not added to `GITHUB_PATH`. #### The old inputs `first`, `second` and `args` still run `diff` in `ghcr.io/nullean/assembly-differ:edge`, with the workspace mounted as before, and print a deprecation warning. #### README A workflow to copy, with the `labeled` and `unlabeled` events that make adding the allow label rerun the check, a table of inputs, and what happens on a pull request from a fork. ## Verify ```bash zizmor --min-severity low action.yml ``` I ran the steps' scripts locally against argh's solution and a Proc package, with a stand-in for the installed tool. The solution suggested `None` and passed. The package suggested `Major` with 5 breaking changes, set the outputs, and exited `4` under `fail-on: major`. **Out of scope:** The action installs the latest released tool, and `pull-request --fail-on --allow-label` arrives in [#83](#83). So the new path works from the first release that carries #83, which is planned as 1.0, the release that also creates the `v1` tag. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pull-request --fail-on majorfails the check on a breaking change, labels itbreaking, and says in the comment that addingbreaking-allowedlets it through. Once someone adds the label, the next run passes.Prompt summary: The GitHub Action should set the
breakinglabel, and it should also allow a configurable allow label. The flow: a library author makes a breaking change, assembly-differ detects it, appliesbreakingand fails. The author applies the allow label, the workflow runs again, and it succeeds.Why
pull-requestlabelled a breaking change but could not hold it back. Failing on it took--fail-onon the comparison step, which knows nothing about labels, so an intended break failed every run until someone loosened the workflow.What
The labels decide the gate
pull-requestnow reads the pull request's labels before it writes anything. With--fail-on major, aMajorsuggestion fails with exit code4unless the pull request has the allow label. The default isbreaking-allowed, and--allow-labelrenames it. A change below--fail-onpasses as before. The release label is set either way, sobreakingstays on the pull request after the break is allowed.The comment says what to do
A blocked change opens the comment with a caution: the check fails, and adding
breaking-allowedallows it if the change is intended. An allowed change gets a note that the label allows it. The console says the same.Runs without labels
Outside a pull request there are no labels, so
--fail-onapplies as it does on the other commands. A read-only token, as on a pull request from a fork, can still read the labels, so the gate works there too; only the comment and label writes are skipped, with a warning.Verify
The workflow has to run on the
labeledandunlabeledpull request events, so adding the label runs the check again; the README says so, and the GitHub Action pull request sets it up.Stack: 2 of 2, on top of #82.
🤖 Generated with Claude Code